
using System;
using Qdb.Reflect;
using Qdb.Typehandlers;

namespace Qdb.Typehandlers
{
	/// <summary>allows installing a Typehandler for a single class.</summary>
	/// <remarks>allows installing a Typehandler for a single class.</remarks>
	public sealed class SingleClassTypeHandlerPredicate : ITypeHandlerPredicate
	{
		private readonly Type _class;

		public SingleClassTypeHandlerPredicate(Type clazz)
		{
			_class = clazz;
		}

		public bool Match(IReflectClass classReflector)
		{
			IReflectClass reflectClass = classReflector.Reflector().ForClass(_class);
			return classReflector == reflectClass;
		}
	}
}
